<extend name="Public/base" />
<block name="body">
<style type="text/css">
/*-------- 下拉菜单 --------------*/
.dropMenu{position:absolute;top:0;visibility:hidden;margin-top:-2px; border-top:0;background-color:#eee;padding:4px;width:260px; }
.dropMenu span{float:left; padding-top:10px;}
.dropMenu a:hover{text-decoration:underline;color:#000;}
</style>
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>业务列表</h2>
	</div>
        <h3 style="height: 33px; border-bottom: 1px solid #B1CEEF;line-height: 23px; color: #3176AD; font-weight: bold; margin-bottom: 10px">
         <div style="float:right;">
                <a  class="btn" href="{:U('catdel')}">已删除</a>
                <a  class="btn" href="{:U('add')}">新建预约单</a>
                <a  class="btn" href="{:U('index',array('yytime_start'=>$jryydate['start'],'yytime_end'=>$jryydate['end']))}">今日到店</a>
                <a  class="btn" href="{:U('index')}">所有订单</a>
          </div>      
            <div style="float:right;font-size:9px;color:red; line-height: 31px;">*注：选择<b>“今日到店”</b>后如果要查询其他单据，请先点击<b>“所有订单”</b>按钮。否则可能看到今日有预约的订单。-&gt; </div>
        </h3>
    <div class="data-table table-striped">
        <form action="{:U()}" method="post" style="padding: 5px;
        background: #eee;
        border: 1px solid #ccc;};
        count_form {      
        
        padding: 5px;
        background: #eee;
        border: 1px solid #ccc;};
        count_form {      
        padding: 5px;
        background: #eee;
        border: 1px solid #CFC7C7;">
            <p style="line-height:28px">
                订单ID：<input type="text" class="cusinput" name="Reserve[id]" style="width:120px;" value="{$post_data.id}">
                姓名：<input type="text" name="Reserve[name]" class="cusinput" style="width:120px;" value="{$post_data.name}">
				微信：<input type="text" name="Reserve[qq]" class="cusinput" style="width:120px;" value="{$post_data.qq}">
                手机：<input type="text" name="Reserve[phone]" class="cusinput" style="width:120px;" value="{$post_data.phone}">
				挖潜人：<input type="text" name="Reserve[waqianren]" class="cusinput" style="width:120px;" value="{$post_data.waqianren}">
                    <label>渠道</label>
                    <select name="Reserve[qd]" id="Reserve_cid">
                        <option  value="">全部</option>
                        <volist name="qudao" id="vo">
                        <option value="{$vo.uid|default=null}" <eq name="vo.uid" value="$post_data.qd"> selected</eq>>{$vo.name|default=null}</option>
                        </volist>
                    </select>                                               
               
                        <label>线上门市</label>
                    <select name="Reserve[xsjd]" id="Reserve_usherid">
                        <option value="">所有</option>
                        <volist name="xianshang" id="vo">
                        <option value="{$vo.uid}"  <eq name="vo.uid" value="$post_data.xsjd"> selected</eq> >{$vo.nickname}</option>
                        </volist>
                     </select>    
                        <label>线下门市</label>
                    <select name="Reserve[xxjd]" id="Reserve_usherid">
                        <option value="">所有</option>
                        <volist name="xianxia" id="vo">
                        <option value="{$vo.uid}"  <eq name="vo.uid" value="$post_data.xxjd"> selected</eq> >{$vo.nickname}</option>
                        </volist>
                     </select>   
					 <br>
                              <label>挖潜部门</label>
                    <select name="Reserve[wqbm]" id="wqbm">
                        <option value="">所有</option>
                        <volist name="wqbm" id="vo">
                        <option value="{$vo.id}"  <eq name="vo.id" value="$post_data.wqbm"> selected</eq> >{$vo.title}</option>
                        </volist>
                     </select>      
					<label>挖潜人员</label>					 
					 <select name="Reserve[wqry]" id="wqry">
                        <option value="">所有</option>
                        <volist name="wqry" id="vo">
                        <option value="{$vo.id}"  <eq name="vo.id" value="$post_data.wqry"> selected</eq> >{$vo.title}</option>
                        </volist>
                     </select>      
					 
					 <label>A客奖金</label>	
					 <select name="Reserve[akjj]">
                        <option value="" selected >所有</option>
                        <option value="1" <eq name="post_data.akjj" value="1"> selected</eq>  >已发</option>
                        <option value="2" <eq name="post_data.akjj" value="2"> selected</eq>  >未发</option>
                        </select>
				   
				   <label>成交奖金</label>	
				   <select name="Reserve[cjjj]">
                        <option value="" selected >所有</option>
                        <option value="1" <eq name="post_data.cjjj" value="1"> selected</eq>  >已发</option>
                        <option value="2" <eq name="post_data.cjjj" value="2"> selected</eq>  >未发</option>
                        </select>

                <br>
                建单时间：<input type="text" value="{$post_data.jdtime_start}" name="Reserve[jdtime_start]" class="date" style="width:130px;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})"> - <input type="text" value="{$post_data.jdtime_end}" name="Reserve[jdtime_end]" class="date" style="width:130px;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})">
                预约时间：<input type="text" value="{$post_data.yytime_start}" name="Reserve[yytime_start]" class="date" style="width:80px;" onclick="laydate()"> - <input type="text" value="{$post_data.yytime_end}" name="Reserve[yytime_end]" class="date" style="width:80px;" onclick="laydate()">
                签订时间：<input type="text" value="{$post_data.ddtime_start}" name="Reserve[ddtime_start]" class="date" style="width:80px;"onclick="laydate()"> - <input type="text" value="{$post_data.ddtime_end}" name="Reserve[ddtime_end]" class="date" style="width:80px;" onclick="laydate()">
				线下服务时间：<input type="text" value="{$post_data.xxfwtime_start}" name="Reserve[xxfwtime_start]" class="date" style="width:80px;"onclick="laydate()"> - <input type="text" value="{$post_data.xxfwtime_end}" name="Reserve[xxfwtime_end]" class="date" style="width:80px;" onclick="laydate()">       
                <br>
				进店时间：<input type="text" value="{$post_data.jindtime_start}" name="Reserve[jindtime_start]" class="date" style="width:80px;" onclick="laydate()"> - <input type="text" value="{$post_data.jindtime_end}" name="Reserve[jindtime_end]" class="date" style="width:80px;" onclick="laydate()">
				未到店时间：<input type="text" value="{$post_data.wddtime_start}" name="Reserve[wddtime_start]" class="date" style="width:80px;"  onclick="laydate()"> - <input type="text" value="{$post_data.wddtime_end}" name="Reserve[wddtime_end]" class="date" style="width:80px;"  onclick="laydate()">
                流失时间：<input type="text" value="{$post_data.lstime_start}" name="Reserve[lstime_start]" class="date" style="width:80px;" onclick="laydate()"> - <input type="text" value="{$post_data.lstime_end}" name="Reserve[lstime_end]" class="date" style="width:80px;" onclick="laydate()">
				<label for="">类别</label>
                    <select name="Reserve[lb]" id="Reserve_cid">
                        <option  value="">全部</option>
                        <volist name="liebei" id="vo">
                        <option value="{$vo.uid|default=null}" <eq name="vo.uid" value="$post_data.lb"> selected</eq>>{$vo.name|default=null}</option>
                        </volist>
                    </select>    
				<br>

                    <if condition="in_array(4,session('user_auth.level'))">

                    <else />
                                客服工号：<select name="Reserve[kf]" id="Reserve_service_id">
                        <option value="">所有</option>
                        <volist name="kefu" id="vo">
                        <option value="{$vo.uid}" <eq name="vo.uid" value="$post_data.kf"> selected</eq>  >{$vo.nickname}</option>
                        </volist>
                                           </select>
                    </if>                        
                            订单状态：<select name="Reserve[ywstate]">
                        <option value="" selected >所有</option>
                           <volist name="state" id="vo">
                        <option value="{$vo.uid}" <eq name="vo.uid" value="$post_data.ywstate"> selected</eq>  >{$vo.name}</option>
                        </volist>
                                </select>

                   顾客标签：<select name="Reserve[gkbq]">
                        <option value="" selected >所有</option>
                           <volist name="gkbq" id="vo">
                        <option value="{$vo.uid}" <eq name="vo.uid" value="$post_data.gkbq"> selected</eq>  >{$vo.name}</option>
                        </volist>
                        </select>


            <span class="buttons">
                <input type="submit"  id="submit" class="btn" value="开始查询">
            </span>
            </p>
        </form>
		<form action="{:U('Excel/out')}" METHOD="post" style="  margin-top: -36px;
    margin-left: 600px;">
            <input type="hidden" name="excl" value="1">
            <input type="hidden" name="Reserve[orderid]"  value="{$post_data.orderid}">
            <input type="hidden" name="Reserve[name]" value="{$post_data.name}">
            <input type="hidden" name="Reserve[phone]" value="{$post_data.phone}">
            <input type="hidden" name="Reserve[qq]"  value="{$post_data.qq}">
            <input type="hidden"  name="Reserve[qd]" value="{$post_data.qd}">
            <input type="hidden" name="Reserve[kf]" value="{$post_data.kf}">
            <input type="hidden" name="Reserve[lb]" value="{$post_data.lb}">
            <input type="hidden" name="Reserve[ywstate]" value="{$post_data.ywstate}">
            <input type="hidden" value="{$post_data.jdtime_start}" name="Reserve[jdtime_start]">
            <input type="hidden" value="{$post_data.jdtime_end}" name="Reserve[jdtime_end]">
            <input type="hidden" value="{$post_data.yytime_start}" name="Reserve[yytime_start]" >
            <input type="hidden" value="{$post_data.yytime_end}" name="Reserve[yytime_end]">
            <input type="hidden" value="{$post_data.ddtime_start}" name="Reserve[ddtime_start]">
            <input type="hidden" value="{$post_data.ddtime_end}" name="Reserve[ddtime_end]">
			<input type="hidden" value="{$post_data.lstime_start}" name="Reserve[lstime_start]">
            <input type="hidden" value="{$post_data.lstime_end}" name="Reserve[lstime_end]">
			<input type="hidden" value="{$post_data.wddtime_start}" name="Reserve[wddtime_start]">
            <input type="hidden" value="{$post_data.wddtime_end}" name="Reserve[wddtime_end]">
			<input type="hidden" value="{$post_data.jindtime_start}" name="Reserve[jindtime_start]">
            <input type="hidden" value="{$post_data.jindtime_end}" name="Reserve[jindtime_end]">
            <input type="hidden" name="Reserve[xxjd]" value="{$post_data.xxjd}">
            <input type="hidden" name="Reserve[xsjd]" value="{$post_data.xsjd}">
            <span class="buttons">
            <input type="submit"   class="btn" style="" value="生成报表">
            </span>
        </form>
</div>
	<div class="cf">
<!-- 		<div class="fl">
            <a class="btn" href="{:U('add')}">新 增</a>
            <button class="btn ajax-post confirm" url="{:U('del')}" target-form="ids">删 除</button>
        </div> -->

    <div style="text-align: right;"> 本页共 :<?php echo count($_list); ?> 条数据、套系金额：{$zhongji.setmoney}元、实收金额：{$zhongji.money}元</div>
    </div>
    <!-- 数据列表 -->
    <div class="table-striped">
    <form class="items">
        <table style="background: white;    border-collapse: collapse;    width: 100%;    border: 1px #D0E3EF solid;">

       
        <thead>
            <tr>
            <!-- <th class="row-selected"><input class="check-all" type="checkbox"/></th> -->
            <th class="">ID</th>
            <th >姓名</th>
            <th >微信</th>
            <th class="">手机</th>
            <th style="width:64px;"><a style="color:#FFFFFF" href="<if condition="$_GET['jdtime'] eq 'desc'">{:U('index',array('jdtime'=>'asc'))}<else />{:U('index',array('jdtime'=>'desc'))}</if>">建单日期</a></th>
            <th class=""><a style="color:#FFFFFF" href="<if condition="$_GET['yytime'] eq 'desc'">{:U('index',array('yytime'=>'asc'))}<else />{:U('index',array('yytime'=>'desc'))}</if>">预约时间</a></th>
            <th class=""><a style="color:#FFFFFF" href="<if condition="$_GET['kf'] eq 'desc'">{:U('index',array('kf'=>'asc'))}<else />{:U('index',array('kf'=>'desc'))}</if>">客服</a></th>
            <th style="width:30px;" ><a style="color:#FFFFFF" href="<if condition="$_GET['xsjd'] eq 'desc'">{:U('index',array('xsjd'=>'asc'))}<else />{:U('index',array('xsjd'=>'desc'))}</if>">线上门市</a></th>
            <th style="width:30px;"><a style="color:#FFFFFF" href="<if condition="$_GET['xxjd'] eq 'desc'">{:U('index',array('xxjd'=>'asc'))}<else />{:U('index',array('xxjd'=>'desc'))}</if>">线下门市</a></th>
			<th style="width:30px;">原挖潜人</th>
			<th style="width:30px;">挖潜部门</th>
			<th style="width:30px;">挖潜人</th>
            <th class=""><a style="color:#FFFFFF" href="<if condition="$_GET['qdstase'] eq 'desc'">{:U('index',array('qdstase'=>'asc'))}<else />{:U('index',array('qdstase'=>'desc'))}</if>">渠道</a></th>
            <th class=""><a style="color:#FFFFFF" href="<if condition="$_GET['setmoney'] eq 'desc'">{:U('index',array('setmoney'=>'asc'))}<else />{:U('index',array('setmoney'=>'desc'))}</if>">套系价格</a></th>
            <th class=""><a style="color:#FFFFFF" href="<if condition="$_GET['money'] eq 'desc'">{:U('index',array('money'=>'asc'))}<else />{:U('index',array('money'=>'desc'))}</if>">实收金额</a></th>
            <th style="width:50px;"><a style="color:#FFFFFF" href="<if condition="$_GET['ywstate'] eq 'desc'">{:U('index',array('ywstate'=>'asc'))}<else />{:U('index',array('ywstate'=>'desc'))}</if>">订单状态</a></th>
            <th class=""><a style="color:#FFFFFF" href="<if condition="$_GET['lb'] eq 'desc'">{:U('index',array('lb'=>'asc'))}<else />{:U('index',array('lb'=>'desc'))}</if>">类别</a></th>
			<th class="">线上备注</th>
            <th class="">线下备注</th>
			<th class="">顾客标签</th>
			<th class="">A客奖金</th>
			<th class="">成交奖金</th>
            <th style="width:75px;"><a style="color:#FFFFFF" href="<if condition="$_GET['cztime'] eq 'desc'">{:U('index',array('cztime'=>'asc'))}<else />{:U('index',array('cztime'=>'desc'))}</if>">最后操作</a></th>
            <th class="">操作</th>
            </tr>
        </thead>
        <tbody id="navMenu">
            <notempty name="_list">
            <volist name="_list" id="vo">
            <tr>
              <!--   <td><input class="ids row-selected" type="checkbox" name="id[]" value="{$vo.id}" /></td> -->
                <td class="money_id" name="{$vo.id}" id="{$vo.id}">{$vo.id}</td>
                <td>{$vo.name}</td>
                <td>{$vo.qq}</td>
                <td>{$vo.phone}</td>
                <td>{$vo.jdtime|time_format}</td>
                <td><neq name="vo.yytime" value="0">{$vo.yytime|time_format}</neq></td>
                <td><span><neq name="vo.kf" value="0">{$vo.kf}</neq></span></td>
                <td><span><neq name="vo.xsjd" value="0">{$vo.xsjd}</neq></span></td>
                <td><span><neq name="vo.xxjd" value="0">{$vo.xxjd}</neq></span></td>
				<td>{$vo.waqianren}</td>
                <td><neq name="vo.wqbm" value="0">{$vo.wqbm}</neq></td>
                <td><neq name="vo.wqry" value="0">{$vo.wqry}</neq></td>
                <td><span>{$vo.qd}</span></td>
                <td>
                <span class="setmoney"><neq name="vo.setmoney" value="0">{$vo.setmoney}</neq></span>              
                </td>
                <td>
                <span class="money"><neq name="vo.money" value="0">{$vo.money}</neq></span>              
                </td>
                <td><span   <if condition="($vo['ywzt'] eq 67) OR ($vo['ywzt'] eq 115) OR ($vo['ywzt'] eq 151) "> class="cjstate"
								<elseif condition="($vo['ywzt'] eq 65) OR ($vo['ywzt'] eq 149) OR ($vo['ywzt'] eq 64) "/> class="lsstate"
								<elseif condition="($vo['ywzt'] eq 153) OR ($vo['ywzt'] eq 66) "/> class="sdstate"
								<elseif condition="($vo['ywzt'] eq 63) OR ($vo['ywzt'] eq 148)"/> class="yyjdstate"
								<else /> class="dqdstate"
							</if>  >{$vo.ywstate}</span></td>
                <td><span>{$vo.lb}</span></td>
				<td><span><a href="javascript:" rel='dropmenu{$vo.id}'>{$vo.bz|msubstr=###,0,3,'utf-8',false}</a></span></td>
				<ul id="dropmenu{$vo.id}" class="dropMenu">
					<span> {$vo.bz}</span>
				</ul>
                <td><span><a href="javascript:" rel='dropmenu1{$vo.id}'>{$vo.xxbz|msubstr=###,0,3,'utf-8',false}</a></span></td>
                <ul id="dropmenu1{$vo.id}" class="dropMenu">
                    <span> {$vo.xxbz}</span>
                </ul>
				<td><span>{$vo.gkbq}</span></td>
				<td><span><if condition="$vo['akjj'] eq 1"> 已发
								<elseif condition="$vo['akjj'] eq 2 "/> 未发
								<else /> 
							</if></span></td>
				<td><span><if condition="$vo['cjjj'] eq 1"> 已发
								<elseif condition="$vo['cjjj'] eq 2 "/> 未发
								<else /> 
							</if></span></td>
                <td><span>{$vo.cztime|time_format}</span></td>
                <td>
                    <a class="gengxin" title="查看" href="{:U('cat?id='.$vo['id'])}"><img src="/Public/Admin/images/view.png" alt="查看"></a>
                    <a  title="更新 " class="gengxin"  href="{:U('edit',array('id'=>$vo['id'],'p'=>$_GET['p']))}"><img src="/Public/Admin/images/update.png" alt="更新"></a>
                    <a class="confirm ajax-get" title="删除" href="{:U('del',array('id'=>$vo['id'],'p'=>$_GET['p']))}"><img src="/Public/Admin/images/delete.png" alt="删除"></a>
                    <a title="分配"  class="fenpei"  href="{:U('fp',array('id'=>$vo['id']))}"><img src="/Public/Admin/images/group_go.png" alt="分配"></a>
                    <a class="confirm ajax-get" title="未到店" href="{:U('wdd?id='.$vo['id'])}"><img src="/Public/Admin/images/come.png" alt="未到店"></a>
                    <a class="cj ajax-get" href="javascript:void(0);" title="成交"  ><img src="/Public/Admin/images/done.png" alt="成交"></a>
					<a  id='yongjin' href="javascript:yongjin({$vo.id});" title="修改佣金"  ><img src="/Public/Admin/images/update.png" alt="修改佣金"></a>
                </td>
            </tr>
            </volist>
            <else/>
            <td colspan="24" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
        </tbody>
        </table>
    </form>
	</div>
    <div class="page">
        {$_page}
    </div>
<div id="bg"></div>
<div class="box" style="display:none">
    <h2>成交<a href="#" class="close">关闭</a></h2>
	<div class="fakeloader"></div>
    <div class="list">
	
        <ul><form action="" id="commentForm" method="post"  class="form-horizontal" >
			<input class="showbtn" type="hidden" name="id" value=""/>
			<div class="form-item">
				<label class="item-label">订单状态：<span class="check-tips"></span></label>
				<div class="controls">
					<select name="ywstate" >
						<volist name="state" id="vo" offset="5" length='7'>
							<option value="{$vo.uid|default=null}" <eq name="vo.uid" value="$data.ywstate"> selected</eq>>{$vo.name|default=null}</option>
						</volist>
					</select>
				</div>
			</div>
			<div class="form-item">
				<label class="item-label">成交金额：<span class="check-tips"></span></label>
				<div class="controls">
					<input type="text" name="money" value="">
				</div>
			</div>
			<div class="form-item">
			<label class="item-label">支付款项：<span class="check-tips"></span></label>
				<div class="controls">
							
					<select name="zfkx">
							<option value="">无</option>
						<volist name="zfkx" id="vo">
							<option value="{$vo.uid|default=null}" <eq name="vo.uid" value="$data.zfkx"> selected</eq>>{$vo.name|default=null}</option>
						</volist>
					</select>
				</div>
			</div>
            <div class="form-item">
			<label class="item-label">支付方式：<span class="check-tips"></span></label>
				<div class="controls">
							
					<select name="zffs">
							<option value="">无</option>
						<volist name="zffs" id="vo">
							<option value="{$vo.uid|default=null}" <eq name="vo.uid" value="$data.zffs"> selected</eq>>{$vo.name|default=null}</option>
						</volist>
					</select>
				</div>
			</div>
			<div class="form-item">
				<label class="item-label">排档时间<span class="check-tips">（如拍档时间只有1天，只填写开始时间，若果多天需要填写结束时间）</span></label>
				<div class="controls">
					 <input type="text" placeholder="请输入拍档开始时间" class="text laydate-icon" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" name="pdtimes" > - 
					 <input type="text" placeholder="请输入拍档结束时间" class="text  laydate-icon" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" name="pdtimee" >
				</div>
			</div>
			<div style="margin-top:10px;">
				<button class="btn tijiao" id="submit" type="submit">确 定</button>
			</div>
			</form>
        </ul>
    </div>
	<div id="AjaxLoading" class="showbox">
		<div class="loadingWord"><img src="__IMG__/waiting.gif">数据提交中，请稍候...</div>
	</div>
</div>

</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
	<script src="__STATIC__/thinkbox/laydate.js"></script>
	<script src="__STATIC__/thinkbox/fakeLoader.min.js"></script>
	<script src="__STATIC__/layer/layer.js"></script>
	<script type='text/javascript' src='__STATIC__/thinkbox/dropdown.js'></script>
	<script type="text/javascript">cssdropdown.startchrome("navMenu")</script> 
	<script type="text/javascript">
	
	
	//iframe层-禁滚动条
	function yongjin(id){
		layer.open({
		  type: 2,
		  title: '佣金修改',
		  area: ['600px', '500px'],
		  skin: 'layui-layer-rim', //加上边框
		  content: ['/index.php?s=/Ywxt/yongjin/id/'+id, 'no']
		});
	}
     var wqbm       = $('#wqbm');
     var wqry       = $('#wqry');
	 wqbm.change(function(){
                if($(this).val() == ''){
                    wqry.empty();
                    $("<option value=''>"+'请选择挖潜人员'+"</optinon>").appendTo(wqry);
                }else{
                    wqry.empty();
                    $("<option value=''>"+'请选择挖潜人员'+"</optinon>").appendTo(wqry);
                    $.post("{:U('waqian/waqianrenyuan')}", { id:$(this).val()},function(data){
                        $.each(eval(data),function(i,n){
                            $("<option value='"+n.id+"'>"+n.title+"</optinon>").appendTo(wqry);
                        });
                    });
                }
            });
    //成交功能		
       $(".tijiao").click(function(){
	    //alert('ssss');	
            $.ajax({
                type: "POST",
                url: "{:U('cj')}",
                data: $("form").serialize(),
                beforeSend:function(){
                $(".overlay").css({'display':'block','opacity':'0.8'});
                $(".showbox").stop(true).animate({'margin-top':'300px','opacity':'1'},200);//loanding 打开显示
                    
                },
                success: function(msg){
                $(".showbox").stop(true).animate({'margin-top':'250px','opacity':'0'},400);
                $(".overlay").css({'display':'none','opacity':'0'});//loanding 停止显示    
                $('.alert-content').html(msg.info);
                    $('#top-alert').addClass('alert-success').show();
                    setTimeout(function(){
                       location.href=msg.url;
                    },2000); //延迟演示
                },
            });
			return false;	
        });
		$(".tijiao").ajaxStart(function(){
				$(".fakeloader").fakeLoader({
					bgColor:"#9b59b6",
					spinner:"spinner7"
				});
		});
	
    //点击显示成交按钮
    $(".cj").click(function(){ 
        var username = "{$quanxian}"; 
        if(username == 4){
            $('#top-alert').show();
            $('.alert-content').html('您没有权限！');
            setTimeout(function(){$('#top-alert').hide();},2000);
        }else{
        //$(this).parent().parent('tr').find('span').siblings().show();
        var money = $(this).parent().parent('tr').find('.money_id').html();
		$(".showbtn").val(money);
		//弹出层
			//$(".showbtn").click(function () {
		

				$("#bg").css({
					display: "block", height: $(document).height()
				});
				var $box = $('.box');
				$box.css({
					//设置弹出层距离左边的位置
					left: ($("body").width() - $box.width()) / 2 + 100 + "px",
					//设置弹出层距离上面的位置
					top: ($(window).height() - $box.height()) / 2 + $(window).scrollTop() + "px",
					display: "block"
				});
			//});
			//点击关闭按钮的时候，遮罩层关闭
			$(".close").click(function () {
				$("#bg,.box").css("display", "none");
			});
        }
        return false;
    });
    //点击显示分配按钮，ajax.get方法判断是否用户有权
    $(".fenpei").click(function(){
         var fenpeiurl = $(this).attr("href"); //获取当前标签中的URL
         $.get(fenpeiurl,function(data){
                    //alert("info: " + data.info + "\nStatus: " + data.status);
                    if(data.status == 0){ //判断是否有权限，0表示假
                       $('#top-alert').show();
                       $('.alert-content').html(data.info);
                       setTimeout(function(){$('#top-alert').hide();},2000); 
                    }else{
                        location.href = fenpeiurl; //跳转
                    }
                 });
            
         return false; 
    });
   //点击显示编辑按钮
   $(".gengxin").click(function(){
         var gengxinurl = $(this).attr("href"); //获取当前标签中的URL
         $.get(gengxinurl,function(data){
                    //alert("info: " + data.info + "\nStatus: " + data.status);
                    if(data.status == 0){ //判断是否有权限，0表示假
                       $('#top-alert').show();
                       $('.alert-content').html(data.info);
                       setTimeout(function(){$('#top-alert').hide();},2000); 
                    }else{
                        location.href = gengxinurl; //跳转
                    }
                 });
            
         return false; 
    });
	//搜索功能
	$("#search").trigger(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click(function(){
                 $(this).parent().parent('tr').find('td.money'); 
            });
			
		}
	});
     //导航高亮
            highlight_subnav('{:U('index')}');
	</script>
</block>
